package com.webdesign.dao.jdbc;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

import com.webdesign.util.SystemUtil;

/*
 * 连接数据库的基类
 */
public class DBConnection {
	public static Connection getConnection() throws SQLException{
		Connection conn = null;
		DriverManager.registerDriver(new com.mysql.jdbc.Driver());
		//注意这里的编码，不然中文会乱码
		conn = (Connection) DriverManager.getConnection(SystemUtil.getAppConfig("url"),SystemUtil.getAppConfig("username"), SystemUtil.getAppConfig("password"));
	    return conn;
	}
}
